package activities;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import bookless.pakage.BookHandler;
import bookless.pakage.R;

public class RemoveBookActivity extends Activity {
	
	private static Context context;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.removebook);
		
		context = RemoveBookActivity.this;
		
		Button addBook;
		addBook = (Button) findViewById(R.id.removeBookBtn);
		addBook.setOnClickListener(new View.OnClickListener() {
	        
        	@Override
        	public void onClick(View v) {
        		
        		EditText t = (EditText) findViewById(R.id.removeTitle);
        		String title = t.getText().toString();
        		
        		
        		BookHandler.removeBook(title);
        		
        		startActivity(new Intent("bookless.pakage.MYPAGE"));
        	}
        });
		
		
	}

	public static Context getContext(){
		return context;
	}
}
